#include <func.h>

typedef struct node {
    int val;
    struct node* next;
} Node;

// 遍历链表、删除结点
void delete_duplicates(Node* head)
{
    // 边界检查
    if (head == NULL || head->next == NULL) {
        return ;
    }
    Node* prev = head;
    Node* curr = head->next;
    while (curr) {
        if (curr->val == prev->val) {
            prev->next = curr->next;
            free(curr);
            curr = prev->next;
        } else {
            prev = curr;
            curr = curr->next;
        }
    } // curr == NULL
}

int main(int argc, char* argv[])
{
    return 0;
}

